package com.riant.day06;

import java.io.Serializable;

/**
 * @Classname Singleton
 * @Description TODO
 * @Date 2021/3/18 0:14
 * @Created by 张斌
 */
public class Singleton {
    public static <T extends Comparable & Serializable> T smallest(T[] t){
        if(t==null||t.length==0)
            return null;
        T small=t[0];
        for(int i=1;i<t.length;i++){
            if(small.compareTo(t[i])>0){
                small=t[i];
            }
        }
        return small;
    }
}
